#include <iostream>

class Camera{
public:
    virtual ~Camera(){}
    virtual int get_frame() = 0;
};

class BaslerCamera: public Camera{
    int get_frame(){
        std::cout << "basler get frame" << std::endl;
        return 1;
    }
};

class FleaCamera: public Camera{
    int get_frame(){
         std::cout << "flea get frame" << std::endl;
         return 2;
     }
};


class CameraManager{
public:
    static Camera* get_camera(const std::string& _camera_name){
        if("basler" == _camera_name){
            return new BaslerCamera();
        }
        else if("flea" == _camera_name){
            return new FleaCamera();
        }
        else
            return nullptr;
    }
};

int main(){
    Camera* camera = CameraManager::get_camera("basler");
    camera->get_frame();
    delete camera;

    camera = CameraManager::get_camera("flea");
    camera->get_frame();
    delete camera;
}
